<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>角色管理/新增编辑</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
	<link rel="stylesheet" href="${ctx}/systemStatic/style/admin.css">
	<link rel="stylesheet" href="${ctx}/iconfont/iconfont.css"/>
	<link rel="stylesheet" href="${ctx}/css/public.css">
	<script type="text/javascript">
		var __ctx = "${ctx}";
	</script>
	<style>
		.roleViewForm .layui-col-xs6{
			margin-bottom: 15px;
		}
	</style>
</head>
<body>
<form class="layui-form roleViewForm" action="" lay-filter="roleViewForm" style="padding:20px 28px 2px 0;background: #fff" >
	<div class="layui-col-xs6">
		<label class="layui-form-label">角色名称:</label>
		<div class="layui-input-block">
			<input type="text" name="roleName" class="layui-input alias" readonly>
		</div>
	</div>
	<div class="layui-col-xs6">
		<label class="layui-form-label">角色别名:</label>
		<div class="layui-input-block" >
			<input type="text" name="alias" class="layui-input" readonly>
		</div>
	</div>
	<div class="layui-col-xs6">
		<label class="layui-form-label">子系统名称:</label>
		<div class="layui-input-block" >
			<input type="text" class="layui-input" name="systemName" readonly>
		</div>
	</div>
	<div class="layui-col-xs6">
		<label class="layui-form-label">角色类别:</label>
		<div class="layui-input-block" >
			<input type="text" class="layui-input" name="category" readonly>
		</div>
	</div>
	<div class="layui-col-xs6">
		<label class="layui-form-label">允许删除:</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="allowDel" readonly>
		</div>
	</div>
	<div class="layui-col-xs6">
		<label class="layui-form-label">允许编辑:</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="allowEdit" readonly>
		</div>
	</div>
	<div class="layui-col-xs6">
		<label class="layui-form-label">是否公开:</label>
		<div class="layui-input-block">
			<input type="text" name="isPublic" class="layui-input" readonly>
		</div>
	</div>
	<div class="layui-col-xs6">
		<label class="layui-form-label">是否启用:</label>
		<div class="layui-input-block">
			<input type="text" name="enabled" class="layui-input" readonly>
		</div>
	</div>
	<div class="layui-col-xs6">
		<label class="layui-form-label">是否可切换:</label>
		<div class="layui-input-block">
			<input type="text" name="enableSwitch" class="layui-input" readonly>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">备注:</label>
		<div class="layui-input-block" >
			<textarea type="text" class="layui-input" name="memo" readonly style="height: 110px;overflow: auto;resize: none;"></textarea>
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-input-block" style="text-align: center;margin: 0">
			<a  class="layui-btn cancelView layui-btn-danger">关闭</a>
		</div>
	</div>
</form>
<script src="${ctx}/public/component.js" type="text/javascript"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
	layui.config({
		base: serverPath.systemPath + staticPath.systemPath //静态资源所在路径
	}).extend({
		index: 'index' //主入口模块
	}).use(['index','layer','setter','commons','form','jquery'], function() {
		var layer = layui.layer,commons=layui.commons,setter=layui.setter,form=layui.form,$=layui.jquery;
		var roleId = '${roleId}';
		$.ajax({
			url: serverPath.systemPath + setter.sysLinkPath + "sysRole/get",
			type: "get",
			contentType: 'application/json',
			dataType: 'json',
			data: {roleId: roleId},
			success: function (data) {
				if (commons._filterRecord(data)) {
					var returnDate = data.data;
					form.val('roleViewForm', {
						"roleName": returnDate.roleName,
						"alias": returnDate.alias,
						"systemName": returnDate.systemName,
						"allowDel": returnDate.allowDel === 0 ? "不允许" : "允许",
						"allowEdit": returnDate.allowEdit === 0 ? '不允许' : '允许',
						"isPublic": returnDate.isPublic === 0 ? '不允许' : '允许',
						"enabled": returnDate.enabled === 0 ? '不启用' : '启用',
						"category": returnDate.category,
						"enableSwitch": returnDate.enableSwitch === 0 ? '否' : '是',
						"memo": returnDate.memo
					});
				} else {
					window.parent.layer.alert(data.msg);
				}
			}
		});
		$(".cancelView").click(function () {
			parent.layer.close(parent.layer.getFrameIndex(window.name));
		})
	})
</script>
</body>
</html>